<template>
	<!-- 可设为加载动画 -->
	<view class="">

	</view>

</template>

<script>
	export default {
		data() {
			return {}
		},
		onLoad() {
			console.log(122);
			this.init()
		},
		methods: {
			init() {
				uni.reLaunch({
					url: "/pagesHome/home/home"
				})
				function isMobile() {
					var userAgentInfo = navigator?.userAgent || '';

					var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];

					var mobile_flag = false;

					//根据userAgent判断是否是手机
					for (var v = 0; v < mobileAgents.length; v++) {
						if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
							mobile_flag = true;
							break;
						}
					}
					var screen_width = window.screen.width;
					var screen_height = window.screen.height;

					//根据屏幕分辨率判断是否是手机
					if (screen_width > 325 && screen_height < 750) {
						mobile_flag = true;
					}

					return mobile_flag;
				}
				// console.log(isMobile());
				// if (isMobile()) {
				// 	uni.reLaunch({
				// 		url: "/pagesHome/home/home"
				// 	})
				// } else {
				// 	alert("请使用手机打开")
				// }

			}
		}
	}
</script>

<style>
</style>